package org.shopen.puremvc.model.vo
{
	public class FileType
	{
		public static const PNG : int	= 0;
		public static const JPEG : int 	= 1;
		public static const GIF : int 	= 2;
		
		[Bindable]
		public var code : int = JPEG;
		
		[Bindable]
		public var label : String = "JPEG";
		
		/**
		 * Without dot. Example: png
		 * Wrong example : .png 
		 */			
		[Bindable]
		public var extension : String = "jpg";
		
		public static function createFileType(code : int, label : String) : FileType
		{
			var result : FileType = new FileType(new Dummy());
			result.code = code;
			switch (code)
			{
				case PNG:
					result.extension = "png";
					break;
				case JPEG:
					result.extension = "jpg";
					break;
				case GIF:
					result.extension = "gif";
					break;
				default:
					result.code = JPEG;
					result.extension = "jpg";
					break;
			}
			result.label = label;
			
			return result;
		}
		
		public function FileType(dum : Dummy)
		{			
		}

	}
}
class Dummy
{
	public function Dummy()
	{
		
	}
}